/* 筛选栏整体样式 */
.course-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px;
  background-color: #fdfce8;
  border-bottom: 1px solid #d6d3c4;
  align-items: center;
}

/* 单个筛选组样式 */
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.filter-group label {
  font-size: 14px;
  color: #333;
}

.filter-group select {
  padding: 6px 10px;
  border: 1px solid #d6d3c4;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
  cursor: pointer;
}

/* 排序选项样式 */
.sort-option {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.sort-option:hover, 
.sort-option.active {
  background-color: #e0e0e0;
}

/* 课程卡片容器 */
.course-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  justify-content: center;
}

/* 单个课程卡片样式 */
.course-card {
  width: 280px;
  background-color: #c3fdee;
  border: 1px solid #90caf9;
  border-radius: 4%;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  position: relative; /* 为绝对定位的按钮提供参考 */
}

.course-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.course-card h3 {
  margin-top: 0;
  color: #333;
}

.course-card p {
  margin: 8px 0;
  font-size: 14px;
}

/* 详情按钮样式 */
.course-detail-btn {
  background-color: #62c364;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.course-detail-btn:hover {
  background-color: #52b054;
}

/* 分阶段的颜色区分 */
.course-card[data-stage="大一上"] { background-color: #f8bbd0; }
.course-card[data-stage="大一下"] { background-color: #bbdefb; }
.course-card[data-stage="大二上"] { background-color: #c8e6c9; }

/* 右下角功能按钮组 */
.custom-btn-group {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000; /* 确保在最上层 */
}

/* 主按钮：自定义/保存结果 */
.custom-btn,
.edit-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.custom-btn {
  background-color: rgba(100, 200, 100, 0.2); /* 淡绿色背景 */
  color: #333;
}

.custom-btn:hover {
  background-color: rgba(100, 200, 100, 0.4);
}

/* 编辑模式子按钮（默认隐藏） */
.edit-btn {
  width: 50px;
  height: 50px;
  margin-top: 10px;
  font-size: 12px;
  display: none; /* 初始隐藏 */
}

/* 取消按钮样式 - 新增 */
#cancelCustomBtn {
  background-color: rgba(180, 180, 180, 0.2); /* 浅灰色背景 */
}
#cancelCustomBtn:hover {
  background-color: rgba(180, 180, 180, 0.4);
}

#addCourseBtn {
  background-color: rgba(150, 150, 255, 0.2);
}
#addCourseBtn:hover {
  background-color: rgba(150, 150, 255, 0.4);
}

#bgColorBtn {
  background-color: rgba(150, 255, 150, 0.2);
}
#bgColorBtn:hover {
  background-color: rgba(150, 255, 150, 0.4);
}

#restoreDefaultBtn {
  background-color: rgba(255, 255, 150, 0.2);
}
#restoreDefaultBtn:hover {
  background-color: rgba(255, 255, 150, 0.4);
}

#batchDeleteBtn {
  background-color: rgba(255, 150, 150, 0.2);
}
#batchDeleteBtn:hover {
  background-color: rgba(255, 150, 150, 0.4);
}

#saveResultBtn {
  background-color: rgba(255, 0, 0, 0.2);
  display: none; /* 初始隐藏，编辑模式显示 */
}
#saveResultBtn:hover {
  background-color: rgba(255, 0, 0, 0.4);
}

/* 课程卡片：删除/编辑按钮（默认隐藏） */
.card-delete {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: red;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
  display: none; /* 初始隐藏 */
}

.card-edit {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: green;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: none; /* 初始隐藏 */
}

/* 编辑模式：禁用卡片 hover 放大 */
.edit-mode .course-card:hover {
  transform: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 筛选栏：编辑分类按钮（默认隐藏） */
.edit-filter-btn {
  background-color: #fdfce8;
  border: 1px solid #d6d3c4;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: none; /* 初始隐藏 */
}

/* 模态框通用样式（复用全局.modal-content，补充特有样式） */
.course-modal,
.edit-modal,
.add-course-modal,
.style-setting-modal,
.restore-modal,
.batch-delete-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

/* 不同模态框层级区分 */
.edit-modal { z-index: 1001; }
.add-course-modal, .style-setting-modal { z-index: 1002; }
.restore-modal, .batch-delete-modal { z-index: 1003; }

/* 模态框内容区（基于全局.modal-content补充） */
.modal-content {
  background-color: #fefefe;
  padding: 20px;
  border: 1px solid #888;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* 课程详情模态框特有样式 */
.course-modal .modal-content {
  width: 60%;
  max-width: 800px;
}

/* 编辑/添加课程模态框特有样式 */
.edit-modal .modal-content,
.add-course-modal .modal-content {
  width: 600px;
  max-height: 80vh; /* 高度不超过视口的80%，避免溢出 */
  overflow-y: auto; /* 内容过长时显示垂直滚动条 */
}

/* 样式设置模态框特有样式 */
.style-setting-modal .modal-content {
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

/* 恢复默认/批量删除模态框特有样式 */
.restore-modal .modal-content,
.batch-delete-modal .modal-content {
  background-color: #f0f8ff;
  width: 500px;
}

/* 模态框内元素样式 */
.close-btn, .modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover {
  color: #f44336;
}

.modal-title {
  color: #62c364;
  margin-top: 0;
}

.modal-intro {
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-resources {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
}

.modal-resources h3 {
  margin-top: 0;
  color: #333;
}

.modal-resources a {
  color: #68bdf3;
  text-decoration: none;
}

.modal-resources a:hover {
  text-decoration: underline;
}

/* 表单相关样式 */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: flex;
  width: 400px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 300px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.modal-buttons {
  text-align: right;
  margin-top: 20px;
}

.modal-buttons button {
  padding: 6px 12px;
  margin-left: 10px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.modal-buttons button:first-child {
  background-color: #ccc;
}

.modal-buttons button:last-child {
  background-color: #4CAF50;
  color: white;
}

/* 样式设置模态框表单布局 */
.style-setting-modal .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.style-setting-modal .bg-settings,
.style-setting-modal .card-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.style-setting-modal .form-group label {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.style-setting-modal input[type="color"],
.style-setting-modal select,
.style-setting-modal input[type="file"] {
  margin-top: 4px;
  width: 220px;
}

/* 多选下拉框样式 */
#cardCourseSelect {
  min-height: 100px;
  width: 100%;
  margin: 5px 0;
}

/* 批量删除模态框相关样式 */
.selection-controls {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

/* 自定义多选列表 */
.custom-multi-select {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px;
  height: 200px;
  overflow-y: auto;
}

.course-item {
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 2px;
}

.course-item.selected {
  background-color: #e3f2fd;
}